// Inline form row with two inputs and remove and move button controls
// ----------------------------------------------------

// <ng-form ng-class="{ 'has-sort' : ... ">
//   <div class="row form-row-has-controls input-labels">
//     <div class="col-xs-6">
//       <label class="input-label"> ...
//     <div class="col-xs-6">
//       <label class="input-label"> ...
//   <div class="row form-row-has-controls has-label">
//     <div class="form-group col-xs-6"> ...
//     <div class="form-group col-xs-6"> ...
//     <div class="form-row-controls">
//       <button class="sort-row"> ...
//       <button class="btn-remove close delete-row"> ...

.as-sortable-dragging {
  margin-left: @form-row-has-controls-position-offset-with-two-buttons;
}
.as-sortable-placeholder {
  border-top: @as-sortable-placeholder-border-top-width @as-sortable-placeholder-border-top-style @as-sortable-placeholder-border-top-color;
  clear: left;
  width: @as-sortable-placeholder-width;
}

.form-row-has-controls {
  position: relative;
  width: ~"calc(100% - @{form-row-has-controls-width-offset-with-one-button})";
  @media(min-width: @screen-sm-min) {
    width: ~"calc(100% - @{form-row-has-controls-width-offset-with-two-buttons})";
  }
  .has-sort &,
  .as-sortable-dragging & {
    width: ~"calc(100% - @{form-row-has-controls-width-offset-with-two-buttons})";
    .form-row-controls {
      // offset by width of two buttons and 8px gutter
      right: -@form-row-has-controls-position-offset-with-two-buttons;
    }
  }
  // Two column padding adjustments to keep associated inputs close together
  > [class*="col-xs-"]:nth-child(1n) {
    padding-right: 0;
  }
  > [class*="col-xs-"]:nth-child(2n) {
    padding-left: @form-row-control-button-gutter;
    padding-right: 0;
  }
  .form-row-controls {
    position: absolute;
    // offset by width of one button and 8px gutter
    right: -@form-row-has-controls-position-offset-with-one-button;
    top: 0;
    button.close,
    button.sort-row {
      background: transparent;
      border: 0;
      height: @form-row-control-button-height;
      line-height: 1;
      // match pf .close rule https://github.com/patternfly/patternfly/blob/master/src/less/close.less#L11
      opacity: @as-sortable-dragging-opacity;
      width: @form-row-control-button-width;
      -webkit-appearance: none;
      &:focus,
      &:hover {
        opacity: @as-sortable-item-icon-hover-opacity;
      }
      .fa-bars,
      .pficon-close {
        display: flex;
        justify-content: center;
      }
    }
    button.close {
      font-size: @btn-close-icon-font-size;
    }
    button.sort-row {
      cursor: move;
      font-size: @as-sortable-item-icon-font-size;
    }
  }
}

.static-form-value-large {
  .h3();
  margin-top: 3px;
}

.clear-env-changes-link {
  vertical-align: -2px;
}

// Generic class to wrap a single form element row that contains multiple actions separated by a divider
.form-group-actions .btn-link {
  padding: 0;
}

// don't allow copy-to-clipboard .input-groups get bigger than 300px so Github webhook secrets aren't revealed within the input-group
copy-to-clipboard .input-group.limit-width {
  max-width: 300px;
}

.copy-to-clipboard {
  input.form-control[readonly] {
    background-color: white;
    color: @text-color;
  }
  .jenkinsfile-examples & {
    margin-top: 3px;
  }
}

.copy-to-clipboard-multiline {
  display: block;
  overflow-x: auto;
  a {
    box-shadow: none;
    position: absolute;
    right: 0;
    top: 0;
  }
  pre {
    background-color: #fff;
    word-break: normal;
    word-wrap: normal;
  }
}

.input-group-addon.wildcard-prefix {
  padding-left: 10px;
}

.editor-examples {
  padding: 19px;
  margin-bottom: 20px;
  border: 1px solid @color-pf-black-300;
}

.compute-resource {
  margin-bottom: 5px;
}

@media (max-width: @screen-xs-max) {
  .compute-resource .inline-select {
    // Spacing below input at mobile sizes.
    margin-top: 5px;
  }
}

.weight-slider-values {
  display: flex;
  flex-direction: column;
  .service-name {
    font-weight: 600;
  }
  .weight-percentage {
    font-size: 15px;
    margin-left: 5px;
  }
  @media (min-width: @screen-sm-min) {
    flex-direction: row;
    justify-content: space-between;
    .weight-percentage {
      margin-right: 5px;
    }
  }
}

.osc-file-input textarea {
  font-family: @font-family-monospace;
  // Use the same spacing as `help-block` so the textarea is evenly spaced under the help text.
  margin: 5px 0;
}

.health-checks-form .pause-rollouts-checkbox,
.set-limits-form .pause-rollouts-checkbox {
  // Add extra margin on some forms so it's clear the checkbox is not part of
  // the sections just above.
  margin-top: @line-height-computed;
}

// Switch default bootstrap margin from left to the right side to enable left alignment of inputs at mobile
.radio-inline,
.radio-inline + .radio-inline,
.checkbox-inline,
.checkbox-inline + .checkbox-inline {
  margin-left: 0;
  margin-right: 10px;
}

.ui-select-dropdown {
  z-index: @zindex-navbar-fixed + 1;
}
